<template>
	<view class="add_box">
		<view class="infoItem wp entry dpflxrjb card ">
			<text class="iTitle">预约到店：</text>
				<picker class="iContent" mode="selector" :range="array" :value="index" @change="bh">
					<text>{{array[index123]}}</text>
					<view class="downArrow frt"></view>
				</picker>
			

			
		</view>
		<view class="infoItem wp entry dpflxrjb ">
			<text class="iTitle">到店日期：</text>
			<picker class="iContent" mode="date" @change="date_bh">
				<text>{{index456}}</text>
				<view class="downArrow frt"></view>
			</picker>
		</view>
		<view class="infoItem wp entry dpflxrjb ">
			<text class="iTitle">到店时间：</text>
			<picker class="iContent" mode="time" @change="date_bh1">
				<text>{{index789}}</text>
				<view class="downArrow frt"></view>
			</picker>
		</view>
		<view class="infoItem wp entry dpflxc note">
		    <text class="iTitle">跟进内容：</text>
		    <textarea maxlength="500"  @input="input" placeholder="请输入跟进内容..." placeholder-style="font-size:28rpx;line-height:28rpx;color:#999;">
		    </textarea>
		</view>
		
		<button class="btn_box5" @click="confirm">确认</button>

	</view>
</template>

<script>
	import request from "@/api/index.js";
	export default {
		data() {
			return {
				array: ['是', '否'],
				index123:0,
				index456: new Date().toISOString().slice(0, 10),
				index789:'00:00',
				index:0
			}
		},
		onLoad(options){
			console.log(options.userid);
			this.userid=options.userid;
		},
		methods: {
			bh(e) {
			console.log(e.detail.value);
			this.index123=e.detail.value;
			},
			date_bh(e) {
			console.log(e.detail.value);
			this.index456=e.detail.value;
			},
			date_bh1(e) {
			console.log(e.detail.value);
			this.index789=e.detail.value;
			},
			input(e) {
			console.log(e.detail.value);
			this.content=e.detail.value;
			},
			confirm(e) {
				
				var preConvention=this.index123+1;
				var actualTimeStr=this.index456;
				// var date=new Date(actualTimeStr);
				// var time3 = Date.parse(date);
				// var rt=time3/1000;
				// console.log(this.index789);
				var actualTimeStr1=actualTimeStr+' '+this.index789;
				var content=this.content;
				var userId=this.userid;
				// console.log(preConvention);
				console.log(actualTimeStr1);
				// console.log(content);
				// console.log(userId);return false;
				if(!content){
					uni.showToast({
						title:"请输入跟进内容",
						icon:'none'
					})
					return
				}
				request.http('/shop/store-api/' + uni.getStorageSync('shop_id') + '/frontUserinfo/tarckAdd', 'POST',{
					'preConvention': preConvention,
					'actualTimeStr': actualTimeStr1,
					'content': content,
					'userId':userId
				},'运行中...').then(res => {
					uni.redirectTo({
						url: "/pages/index_membership_detail_record/index_membership_detail_record?userid="+userId
					})
				})
			},
		}
	}
</script>

<style src="../../static/css/app.css"></style>
<style>

</style>
